package com.gs.zhss.eshop.test.testclass;

/**
 * @Author: gs
 * @Date: 2024/1/2 20:30
 * @Version: v1.0.0
 * @Description: TODO
 **/
public class Child extends Base {

    public static int s;
    private int a;

    static {
        System.out.println("1.孩子静态代码块 s = "+s);
        s = 10;
        System.out.println("2.孩子静态代码块 s = "+s);
    }

    {
        System.out.println("3.子类实例代码块 a = "+a);
        a = 10;
        System.out.println("4.子类实例代码块 a = "+a);
    }

    public Child(){
        System.out.println("5.构造方法 a = "+a);
        a = 20;
        System.out.println("6.构造方法 a = "+a);
    }

    protected void step(){
        System.out.println("child s = "+s+",a = "+a);
    }
}
